"""
YouTour - Create and access tours based on public transport routes. 
Copyright (C) 2011 Karl Beecher

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

from google.appengine.ext import db
from google.appengine.ext.blobstore import blobstore


class TourDB(db.Model):

    #languageId = ""

    # List of descriptions of the tour (each a different language version of same tour)
    #tourDescriptionList = {}

    #countryId = ""

    #cityId = ""

    title = db.StringProperty(multiline = False)

    description = db.StringProperty(multiline = True)

    startPosition = db.StringProperty(multiline = False)

    endPosition = db.StringProperty(multiline = False)

    startTime = db.TimeProperty(auto_now = False, auto_now_add = False)

    endTime = db.TimeProperty(auto_now = False, auto_now_add = False)

    # List of tickets needed    
    #ticketList = {}


class StopDB(db.Model):

    # Stop number on the tour
    stopNumber = db.IntegerProperty()

    # Reference to the tour this stop belongs to
    tourId = db.ReferenceProperty(TourDB,
                                  collection_name = "stops")

    # Co-ordinates ?
    # position = 

    # Description of tour
    # descriptionList = {}
    description = db.StringProperty(multiline = True)

    audioFile = blobstore.BlobReferenceProperty()

    # List of image files
    # imageFileList = 

    # List of directions in multiple languages
    # directionsList = 
    directions = db.StringProperty(multiline = True)
